<?php
if (!defined('BASEPATH'))
	exit('No direct script access allowed');

class Home extends CI_Controller {

	/**
	 *  Главная страница
	 *
	 */

	public function index() {
		$this -> load -> model('Views_modul', 'views');
	#	$this -> load -> model('News_modul', 'news');
		$this -> load -> model('Forum_modul', 'forum');

		$data['forum'] = $this -> forum -> posting();

	#	$data['news'] = $this -> news -> listing(0, 3);
		
		
		$this -> views -> content = $this -> load -> view('content/home', $data, true);

		$content = $this -> views -> request_view();

		$this -> load -> view('home', $content);

	}

	// отображение статических страниц
	public function page($url, $ids = 0) {
		
				$this -> load -> model('Views_modul', 'views');
				
				
		$lts = true;
		switch ($url) {
			case 'well' :
				# статьи
				$url = 'articles/articles_well.php';
					$this -> views -> title = '';
					$this -> views -> content = $this -> load -> view('pages/' . $url, '', TRUE);
					$content = $this -> views -> request_view();
					$this -> load -> view('home', $content);
				break;
			case 'dogovor' :
				# статьи
				$url = 'articles/articles_dogovor.php';
					$this -> views -> title = '';
					$this -> views -> content = $this -> load -> view('pages/' . $url, '', TRUE);
					$content = $this -> views -> request_view();
					$this -> load -> view('home', $content);
				break;
			case 'yur' :
				# статьи
				$url = 'articles/articles_yur.php';
					$this -> views -> title = '';
					$this -> views -> content = $this -> load -> view('pages/' . $url, '', TRUE);
					$content = $this -> views -> request_view();
					$this -> load -> view('home', $content);
				break;
			case 'realtos' :
				# статьи
				$url = 'articles/articles_realtor.php';
					$this -> views -> title = '';
					$this -> views -> content = $this -> load -> view('pages/' . $url, '', TRUE);
					$content = $this -> views -> request_view();
					$this -> load -> view('home', $content);
				break;
			case 'construction' :
				# статьи
				$url = 'articles/articles_construction.php';
					$this -> views -> title = '';
					$this -> views -> content = $this -> load -> view('pages/' . $url, '', TRUE);
					$content = $this -> views -> request_view();
					$this -> load -> view('home', $content);
				break;
			case 'kvart' :
				# статьи
				$url = 'articles/articles_kvart.php';
					$this -> views -> title = '';
					$this -> views -> content = $this -> load -> view('pages/' . $url, '', TRUE);
					$content = $this -> views -> request_view();
					$this -> load -> view('home', $content);
				break;

			case 'template' :
				# шаблон для сапе
				$this -> load -> view("pages/sape/articles_$ids.php", '');
				
				$lts = false;
				break;
				
				
			case 'reklama' :
				# шаблон для сапе
					$this -> views -> title = 'Реклама';
					$this -> views -> content = $this -> load -> view('pages/' . $url, '', TRUE);
					$content = $this -> views -> request_view();
					$this -> load -> view('home', $content);
				break;
				
				
			case 'contact' :
				# шаблон для сапе
					$this -> views -> title = 'Контакты';
					$this -> views -> content = $this -> load -> view('pages/' . $url, '', TRUE);
					$content = $this -> views -> request_view();
					$this -> load -> view('home', $content);
				break;
				
				
			default :
				break;
		}
  

		return;
	}

}

/* End of file welcome.php */
/* Location: ./application/controllers/home.php */
